<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/9/27
 * Time: 20:30
 */

namespace app\admin\model;
use think\Model;
class ProductInfo extends Model
{
    // 设置当前模型对应的完整数据表名称
    protected $table = 'mdm_product';
    protected $connection = [
        'prefix'      => 'pro_',
    ];
    //自动写入时间戳
    protected $updateTime=false;
    protected $autoWriteTimestamp=true;
//    protected $connection = [
//        // 自动写入时间戳字段
//        'auto_timestamp'  => true,
//    ];
//数据类型转换    全栈和php分组
    public function getProsnAttr($value)
    {
        $pro_sn = [1=>'全栈',2=>'PHP'];
        return $pro_sn[$value];
    }

    //数据类型转换    pro_date已完结或者学习中
    public function getProdateAttr($value)
    {
        $pro_date = [1=>'已完结',2=>'学习中'];
        return $pro_date[$value];
    }
}